#ifndef HEROPLANE_H
#define HEROPLANE_H

#include "config.h"
#include "bullet.h"
#include <QPixmap>
#include <QRect>

class HeroPlane
{
public:
    HeroPlane();

    /* 发射子弹 */
    void shoot();

    /* 设置飞机位置 */
    void setPosition(int x, int y);

    /* 飞机图像切换 */
    void picCycle();



public:
    //飞机资源对象
    QPixmap m_Plane;
    QPixmap m_Plane2;
    QPixmap m_PlaneDown[HERO_DOWN_NUM];
    QPixmap *p_Plane;
    //图像切换计数
    int m_PicCycle;

    //生命图标
    QPixmap m_Icon;

    //飞机坐标
    int m_X;
    int m_Y;

    //飞机的矩形边框
    QRect m_Rect;

    //弹夹
    Bullet m_Bullets[BULLET_NUM];

    //子弹发射间隔计数
    int m_Interval;

    //子弹发射位置
    bool m_ShootPlace;
    int m_ShootX;
    int m_ShootY;

    //生命
    int m_life;

    //爆炸状态
    int m_Down;
};

#endif // HEROPLANE_H
